# -*- coding: utf-8 -*-
from common import orm
from common.utils.types import Enum

DAILY_RECHARGE_TYPE = Enum({
    'RECHARGE': ('recharge', 'recharge'),
})

DAILY_RECHARGE_AWARD = {
    DAILY_RECHARGE_TYPE.RECHARGE: {
        100: 2,
        200: 5,
        500: 15,
        1000: 32,
        2000: 72,
        5000: 200,
        20000: 880,
    }
}


class DailyRechargeReturn(orm.Model):
    """
    每日充值返现（元旦充值大狂欢）
    """
    __tablename__ = "daily_recharge_return"
    id = orm.Column(orm.BigInteger, primary_key=True)
    user_id = orm.Column(orm.Integer)
    date = orm.Column(orm.VARCHAR)
    amount = orm.Column(orm.FLOAT, default=0)
    is_awarded = orm.Column(orm.Integer, default=0)
    transaction_id = orm.Column(orm.BigInteger)
    is_notified = orm.Column(orm.Integer, default=0)
    created_at = orm.Column(orm.DATETIME)
    updated_at = orm.Column(orm.DATETIME)
